package com.heima.wemedia.listener;

import com.alibaba.fastjson.JSON;
import com.heima.model.common.dtos.NewsPageDto;
import com.heima.model.common.dtos.ResponseResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;


@Component
@Slf4j
public class CommentListener {

    @KafkaListener(topics = "article_news")
    public ResponseResult getArticlelist(String msg){
        log.info("收到文章列表结果消息，{}",msg);
        ResponseResult result = JSON.parseObject(msg, ResponseResult.class);
        return result;
    }
}